home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / menu / dmmenu10.zip / MENU.DOC < prev    next >
Text File  |  1989-04-01  |  19KB  |  411 lines

  1.  
  2.      MENU PROGRAM                                      C Version
  3.  
  4.                          1.  INTRODUCTION
  5.  
  6.      This  program  was  designed  to  make IBM-compatible computers
  7.      friendlier by allowing  you to run programs from  a simple menu
  8.      -- without  having to type  lengthy DOS commands.  This program
  9.      essentially allows you to enter  DOS instructions once and they
  10.      will be stored in a file for future menu selection.
  11.  
  12.      This  version  has  been  placed  in  the  public domain by its
  13.      author, John  Queern. Thanks to  Bob Sutter for  providing user
  14.      documentation  and   an  enhanced  Pascal   version  (which  is
  15.      available as shareware).
  16.  
  17.      1.1 System  Requirements. Operation requires  an IBM-compatible
  18.      computer with  at least 256K of  memory and DOS 2.1  or higher.
  19.      The program is especially helpful with fixed-disk systems.
  20.  
  21.      1.2 Basic  Operation. The systems  uses the DOS  Batch facility
  22.      extensively. The  program is started  by entering "MENU"  which
  23.      starts  a  batch  file  which  will  in  turn  execute the main
  24.      program, "MENUDRV," then execute the batch file that is created
  25.      --  "MENULOAD." As  long as   the last  entry in  "MENULOAD" is
  26.      another  call  to  the  batch  file  "MENU,"  the sequence will
  27.      continue until  a file is  called that does  not chain back  to
  28.      MENU. The main menu may  also contain "submenus" as desired. As
  29.      indicated in  the tree structure below,  the menus and programs
  30.      can be intermixed and "stacked"  to allow for a more structured
  31.      system operation.
  32.  
  33.                              ┌─────────────┐
  34.                              │ Main Menu   │
  35.                              │             │
  36.                              └──────┬──────┘
  37.                    ┌────────────────┴───────────────┐
  38.           ┌────────┴────────┐                  ┌────┴────┐
  39.           │ Individual      │                  │  Other  │
  40.           │  Programs       │                  │  Menus  │
  41.           │                 │                  └────┬────┘
  42.           │ 1 - Program 1   │           ┌───────────┴─────────┐
  43.           │ A - Program A   │       ┌───┴────┐      ┌─────────┴─────────┐
  44.           │ B - Menu B      │       │ Other  │      │ Individual Menu B │
  45.           │ C - Program C   │       │ Menus  │      │     Programs      │
  46.           │ X - Exit to DOS │       └───┬────┘      │                   │
  47.           └─────────────────┘           │           │ B - Program B1    │
  48.                          ┌──────────────┴───┐       │ D - Program D1    │
  49.                 ┌────────┴──────────┐ ┌─────┴────┐  │ X - Return to Main│
  50.                 │ Other Individual  │ │  Menus   │  └───────────────────┘
  51.                 │    Programs, etc. │ │   Etc.   │
  52.                 └───────────────────┘ └──────────┘
  53.  
  54.  
  55.                       2.0  PROGRAM OPERATION
  56.  
  57.      2.1 Program  Initiation. The menu program  is started by typing
  58.      "MENU"  which  invokes  the  batch  file  "MENU.BAT." This file
  59.      should be created  as listed in one of  the samples in Appendix
  60.      B. As  a minimum, it should  call the main program  MENUDRV and
  61.      then call  the batch file  MENULOAD. Additionally, if  the menu
  62.      programs  are all  loaded  on  a different  subdirectory, there
  63.      should also  be instructions to change  to that directory first
  64.      (e.g. CD\UTILITY\MENU).  Once the program is  started, the main
  65.      menu  that was  selected by  the parameter  will appear  on the
  66.      screen.  A sample  screen is  in Appendix  D. The calendar will
  67.      have the current  day highlighted, and any days  in the current
  68.      month that are located in the  holiday or special files will be
  69.      highlighted  in different  colors or  shades (if  video card is
  70.      capable).
  71.  
  72.      2.2 Adding or  Editing Menu Items. At the  bottom of each menu,
  73.      the F1  key indicates that  you may add  or edit an  item. This
  74.      applies to  the items on  the current menu  only. To adjust  an
  75.      item on another  menu, select that menu first.  If adding a new
  76.      item, you will first be asked if the item is another menu. Your
  77.      response  should   be  "N"  (unless   you  plan  to   create  a
  78.      submenu--see  section 2.3).  Then  a  work window  will appear,
  79.      allowing you to give the item a name, and list the instructions
  80.      to be executed.
  81.  
  82.      2.2.1 Batch-executed  Programs. Batch files  can be created  by
  83.      entering  the  lines  exactly  as  they  would  be  if you were
  84.      creating a batch  file that would run from  DOS. See appendix C
  85.      for a list of the  editing commands. Options can be substituted
  86.      in the batch  file at selection time by  use of square brackets
  87.      ([]s).  Anything  you  place  inside  of  the  brackets will be
  88.      displayed on the screen, and the response typed in will replace
  89.      all that  is enclosed by  the brackets when  the batch file  is
  90.      written. For example, if the menu line contains:
  91.  
  92.                        EDLIN [File to Edit?]
  93.  
  94.      The  menu program  will first   prompt the  user with  "File to
  95.      Edit?" If  you respond with  "ABC.DOC" then the  actual line in
  96.      the batch file will become  "EDLIN ABC.DOC" -- giving you quite
  97.      a bit of versatility.
  98.  
  99.      The last line in the list should normally be "MENU x" where "x"
  100.      is the submenu  you want to display upon  returning to the menu
  101.      after the  program selected is  complete. You should  also note
  102.      that  other batch  files should  not appear  in the list, since
  103.      they  will then  have control,  and a  return to  MENU will not
  104.      occur "automatically."
  105.  
  106.      When you have completed your  changes or additions, press Ctrl-
  107.      W, and the data will be  updated in memory and control returned
  108.      to the  menu. Now when  that item letter  is selected from  the
  109.      menu,  the related  batch lines   will be  written to  the file
  110.      "MENULOAD.BAT,"  and the  program  will  exit. By  exiting, the
  111.      "old" batch  file "MENU.BAT" resumes  control, which will  then
  112.      invoke the  new batch file "MENULOAD.BAT."  Under DOS, starting
  113.      another batch file will terminate  the current batch file, even
  114.      if there are instructions not yet executed.
  115.  
  116.      2.2.2  Programs  Executed  While  Menu  Program Stays Resident.
  117.      MENUDRV  has the  capability to  "terminate and  stay resident"
  118.      while  your selected  program is  executed. This  speeds up the
  119.      execution of  the menu, since  the program must  save files and
  120.      restart from the beginning each time when called from the batch
  121.      files. Several restrictions apply  when using this option. Each
  122.      command  line must  start with  an ampersand  ("&"). Also,  the
  123.      entire  executable file  string must  be listed,  including the
  124.      drive  and  path,  if  appropriate. (Example: C:\UTIL\MAP.COM).
  125.      Only "com"  and "exe" files  may be executed  with this option.
  126.      However, you  can call "command.com"  to execute .BAT  files or
  127.      DOS internal commands like this:
  128.  
  129.                    &C:\COMMAND.COM /C CD \MYDIR
  130.  
  131.      The  "/C" argument  tells COMMAND.COM  to "execute  the command
  132.      which follow, then return." Which  means it can be anything you
  133.      would type in at the DOS prompt.
  134.  
  135.      Upon  termination  of  the  selected  program,  control will be
  136.      immediately returned to MENUDRV,  speeding up the menu process.
  137.      Note  that this  option should  only by  used for programs that
  138.      will fit in the memory which  remains after the menu is loaded.
  139.      If all available  memory is needed (such as  in LOTUS 123), you
  140.      should not use this option, but use the option in 2.2.1 above.
  141.  
  142.      2.3 Adding or  Editing Menus. The F1 option  also allows you to
  143.      edit or add another menu selection (the description of the menu
  144.      and  the menu's  "letter.")  Initially,  the same  questions as
  145.      above will be asked, except you  should respond "Y" if asked if
  146.      it is another  menu. Then a window will  appear allowing you to
  147.      add/edit  the description  of the  menu and  the menu letter to
  148.      transfer to. You must also assign  a menu letter. It is easiest
  149.      to have the item letter the  same as the menu letter, but since
  150.      you  can  have  many  items  on  different  menus with the same
  151.      selection letter, it  may not be possible to  have another menu
  152.      with the same letter, since each menu must have a letter unique
  153.      letter. (NOTE: The main menu is  referred to as menu "M").
  154.  
  155.      When  creating  a  new  menu,  one  item  will automatically be
  156.      created for  you - "X -  Exit to DOS." After  selecting the new
  157.      menu, this item can also be edited and changed if desired. Note
  158.      that the last line in that selection will not contain a call to
  159.      MENU, which causes control to return to DOS. Also note that the
  160.      same letters may be used to  refer to items in different menus,
  161.      but each menu  itself must have a unique  letter for reference,
  162.      which  effectively  limits  the  total  number  of menus in the
  163.      system to  36 ("A" through  "Z" and "0"  through "9"), although
  164.      some punctuation may also be used if necessary.
  165.  
  166.      2.4  Deleting Items and  Menus. The F2 option at  the bottom of
  167.      the  screen allows  deletion of  a menu  item on  the displayed
  168.      menu. After asking  for the item letter, you  will be asked for
  169.      confirmation  that you  want to  delete that  item. CAUTION: If
  170.      deleting a  menu item that  selects another menu,  be sure that
  171.      you first  go to the  sub menu and  delete all of  the items on
  172.      that menu  before deleting the  menu itself. Otherwise,  all of
  173.      the sub-items  will remain in  the data base,  assuming you are
  174.      going  to use  them on  another menu  of the  same code option.
  175.      NOTE: This deletion  occurs only in the memory  table until you
  176.      exit the program by running a batch job or select exit. At that
  177.      time all the changes you have made to the options will be saved
  178.      to the default directory in file MENU.DAT.
  179.  
  180.  
  181.      2.5 Setting Colors.  The F4 option on the  menu selects another
  182.      window that  allows you to  select different color  options for
  183.      the  program. Simply  typing one  of the  colors listed  at the
  184.      bottom of  the window will  reset the parameters.  NOTE: On EGA
  185.      cards  (e.g.  Zenith  248),  the  bright  colors will cause the
  186.      screen to  blink where that  color is selected.  The parameters
  187.      will be saved automatically as the program is exited.
  188.  
  189.      2.6 (alarm and chime features are not present in the C version)
  190.  
  191.      2.7 Help  Screens. Help screens  are available for  most of the
  192.      functions.  Once you  have a  basic understanding  of the  menu
  193.      system, the  help menus should  be all that  you need. The  key
  194.      that will  invoke the help  screen is displayed  on each screen
  195.      that has help available.
  196.  
  197.      2.8 Exiting  Program. Exiting the  program is normally  done in
  198.      two ways -- by selecting an item  on the menu that uses a batch
  199.      file that does not contain a  return call to menu, or by typing
  200.      the "END" key. During the  exit process, all the information on
  201.      the items,  menus, and parameters  that had been  in memory and
  202.      were changed, will now be written to the appropriate disk files
  203.      on the default drive. NOTE: If  you are running the menu system
  204.      from a ramdisk,  ensure you have a routine  that copies all the
  205.      changes that you make to the "DAT" files are copied to the disk
  206.      for permanent storage (e.g. use XCOPY, etc.)
  207.  
  208.      2.9  Executing/Running Programs.  Selecting a  menu option from
  209.      the  menu being  displayed simply  creates a  batch file  named
  210.      MENULOAD.BAT containing  the DOS instructions you  gave it when
  211.      creating/editing  it.  Once  this  batch  file  is created, the
  212.      MENUDRV  program terminates.  This in  turn returns  control to
  213.      DOS, which  realizes that the  original batch file  MENU.BAT is
  214.      still  in  control.  The  next  instruction  in that batch file
  215.      should be  MENULOAD, which then transfers  control of the batch
  216.      mechanism  to  MENULOAD,  effectively  terminating the MENU.BAT
  217.      file. Then the instructions  contained in MENULOAD are executed
  218.      sequentially,  with  the  last  instruction  being  a  call  to
  219.      MENU.BAT, restarting the program.
  220.  
  221.      Programs that are  in the data file preceded  with an ampersand
  222.      ("&")  are  not  written  to  a  batch  file.  Instead, MENUDRV
  223.      executes  a  "terminate  and  stay  resident"  instruction  and
  224.      transfers control to the requested program.
  225.  
  226.  
  227.                       4  SETTING YEARLY DATES
  228.  
  229.      The calendar on the menu program screen will not only highlight
  230.      the current  day, but can  also be configured  to highlight two
  231.      other sets of dates in  two different colors/shades. These sets
  232.      are contained in the  files "YEAR.HOL" and "YEAR.SPC". Although
  233.      the names  indicate "holiday" and  "special," they can  be used
  234.      for  any purpose.  The data   is entered  using any  ASCII line
  235.      editor (EDLIN  may be the  simplest.) If using  word processors
  236.      such as Wordstar or Wordperfect, be  sure you save the files as
  237.      DOS text files, not in the programs' unique format.
  238.  
  239.      4.1 Holiday File. This file (YEAR.HOL) contains a chronological
  240.      list of the months and days for the current year's holidays. It
  241.      must be updated each year as the dates change. The format is mm
  242.      dd xxxxxx where mm is the numeric value of the month, dd is the
  243.      day, and xxxxxx reflects any comments that you may have to make
  244.      the entry more readable for the next person who reviews it. The
  245.      comments are  not reflected anywhere  else except in  the file,
  246.      and are  therefore optional. Sample  entries may be  as follows
  247.      (note at least one space between each entry):
  248.  
  249.                        1 1 New Years
  250.                        7 4 July Fourth
  251.                        12 25 Christmas
  252.  
  253.      4.2 Special File. The special  file (YEAR.SPC) can also contain
  254.      dates  to  be  highlighted  on  the  calendar.  Such  events as
  255.      birthdays  or anniversaries  may be  listed. The  format is the
  256.      same  as  above,  except  they  will  show  up  as  a different
  257.      color/shade on the calendar.
  258.  
  259.      4.3 Program  Operation. There is  a special program  "YEAR.COM"
  260.      (in  the Pascal  section) which  will display  an entire year's
  261.      calendar, highlighting the current  day, and any days contained
  262.      in the above  two files. The dates will  be highlighted only if
  263.      the  year  selected  is  the  current  year.  This program is a
  264.      simple,  handy way  of looking  at an  annual calendar, and may
  265.      also be selected from the  menu program, if desired. Since this
  266.      program does not update any files, it may be executed using the
  267.      "terminate  and  stay  resident"  option  of  the menu program,
  268.      speeding up the return to the menu.
  269.  
  270.  
  271.                              APPENDIX A - Program Files
  272.  
  273.  
  274.       MENU.BAT  - The  batch file  controlling the  execution of the
  275.       menu program. See Appendix B  for examples for setting up this
  276.       file.
  277.  
  278.       MENUDRV.EXE - The main menu program.  It requires up to 80K of
  279.       memory to  operate. The program  accepts one parameter  -- the
  280.       letter of the  menu to initially display on  the screen. If no
  281.       parameters  are specified,  it will  load menu  "M" (the  main
  282.       menu.)
  283.  
  284.       MENU.DAT -  The listing of all  the menu options the  user has
  285.       specified. The format is in the form:
  286.  
  287.                            m,s,i Descrip,batch [,batch]
  288.  
  289.       where  the  "m"  indicates  the  name  of  the  menu,  the "s"
  290.       indicates the submenu this item  will invoke ("*" means none),
  291.       and the "i" indicates the item letter to appear on the screen.
  292.       "Descrip"  is  the  description  that  appears  after the item
  293.       letter on  the screen. The DOS  batch commands that are  to be
  294.       executed are  then listed, separated  by commas. "Continuation
  295.       records" start with an "&".  Updating this file is most easily
  296.       done  by the  "F1" option  in the  program itself,  or for the
  297.       brave  and confident,  can  be  created/updated with  any text
  298.       wordprocessor.
  299.  
  300.       YEAR.EXE  - This  program displays  an annual  calendar of the
  301.       year selected.
  302.  
  303.       YEAR.HOL·····-·This file  contains dates to  be interpreted by
  304.       the menu program and YEAR program as holidays.
  305.  
  306.       YEAR.SPC·····-·This file  contains dates to  be interpreted by
  307.       the menu program and YEAR program as special dates.
  308.  
  309.  
  310.  
  311.                 APPENDIX B - Sample MENU.BAT Files
  312.  
  313.  
  314.        The  most basic  MENU.BAT  must  contain the  following three
  315.        entries:
  316.  
  317.                           echo off
  318.                           MENUDRV %1
  319.                           MENULOAD
  320.  
  321.        Another sample for executing from a hard disk subdirectory:
  322.  
  323.                           echo off
  324.                           C:
  325.                           CD\util\menu
  326.                           MENUDRV %1
  327.                           MENULOAD
  328.  
  329.        A sample  of executing from a  RAMDISK subdirectory, ensuring
  330.        any changes  to the data files  are copied to the  fixed disk
  331.        (adjust parameters for your version of DOS):
  332.  
  333.                           echo off
  334.                           if exist D:\MENU\MENUDRV.COM goto ok
  335.                           md D:\MENU
  336.                           copy C:\UTIL\MENU\*.* D:\MENU>NUL
  337.                           :OK
  338.                           d:
  339.                           cd\menu
  340.                           attrib -a *.dat
  341.                           MENUDRV %1
  342.                           xcopy d:\menu\*.dat c:\util\menu /a
  343.                           MENULOAD
  344.  
  345.  
  346.  
  347.                 APPENDIX C - Basic Editing Commands
  348.  
  349.        There is an attempt to  use "standard" editing commands while
  350.        on the screen to input the changes to the batch file listings
  351.        when  using  option  "F1".   The  commands  generally  follow
  352.        Wordstar-type commands.  A "^" before the  key indicates that
  353.        the  "CTRL"  key  should  be  held  down while depressing the
  354.        following key. See the  on-screen help screens for additional
  355.        information.
  356.  
  357.  
  358.                 Home            Goto line 1 column 1
  359.                 PgUp, ^r        Goto top of screen
  360.                 PgDn, ^c        Goto bottom of screen
  361.                 End, ^w         Save changes and exit
  362.                 Ins, ^v         Toggle the insert/overwrite mode
  363.                 Del, ^g         Delete one character
  364.                 ^y              Delete one line
  365.                 ^z              Blank screen
  366.                 ^t              Delete word right
  367.                 ^a/^f           Advance word left/right
  368.                 ^qs/^qd         Goto beginning/end of line
  369.                 ^n              Insert a line
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.